home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / networking / short_timeout / README < prev   
Encoding:
Text File  |  1994-08-02  |  1.6 KB  |  44 lines

  1.  
  2.        ~4Dgifts/toolbox/src/exampleCode/networking/short_timeout README
  3.  
  4.  
  5.  
  6.                         hrq:  host_responds_quickly
  7.  
  8.       Code that checks whether a remote host responds quickly, avoiding
  9.       a long wait for a network timeout.
  10.  
  11.  
  12.       A developer of a networked application may want to know if a host
  13.       is present on the network before the application attempts to make
  14.       use of some resource on that host.  The default network timeouts
  15.       are suitable for use on a WAN, and may seem too lengthy for LAN
  16.       users.
  17.  
  18.       The application may set a short timer, and if the timer expires
  19.       before the network system call completes, the call will fail with
  20.       errno set to EINTR.
  21.  
  22.       The example in this directory may be used as a model of how to
  23.       interrupt a network system call with an alarm, or the example may
  24.       be used without modification in your application.
  25.  
  26.       The function that does all the work is named host_responds_quickly,
  27.       and it is found in file hrq.c.  The application that calls this
  28.       function must #include header file hrq.h.  The file main.c contains
  29.       a trivial driver that calls host_responds_quickly.
  30.  
  31.       An application written in a shell language may invoke the complete
  32.       program hrq.  There's an example of how this can be done in the
  33.       Bourne shell in script file hrq.sh.
  34.  
  35.       Program hrq (and any other program calling host_responds_quickly)
  36.       needs to be installed setuid to root.    In a root shell, type
  37.  
  38.                 chown root.sys hrq
  39.                 chmod 4755 hrq
  40.                 mv hrq /usr/local/bin
  41.  
  42.  
  43.  
  44.